package com.bing.utils;

import com.bing.bean.weixin.MsgType;

import javax.xml.bind.annotation.adapters.XmlAdapter;

/**
 * Created by kaibb on 2014/11/29.
 */
public class MsgTypeAdapter extends XmlAdapter<String, MsgType> {

    @Override
    public MsgType unmarshal(String v) throws Exception {
        return MsgType.valueOf(v);
    }

    @Override
    public String marshal(MsgType v) throws Exception {
        return "<![CDATA[" + v.toString() + "]]>";
    }
}
